<!-- 
 - createAnalysis.php
 - v1.0
 - 2/1/2011
 -
 - This source code displays the user interface for creating an analysis.
-->
 
<?php
	session_start();
	require 'libraries/GetCaslNum.php';
	require 'libraries/UserLibrary.php';
	
	isSessionSet("administrator", null, "index.php");
?>
<html>
	<head>
		<title>CASLIMS | Sample Entry Page</title>
		<link rel="stylesheet" type="text/css" href="scripts/page.css" />
		<script type="text/javascript" src="scripts/validateSampleEntry.js"></script>
		<link href="tools/favicon.ico" rel="shortcut icon" type="image/x-icon" /> 
	</head>
	<body>
		<div id="header"></div>
		<div id="wrapper">
			<div id="pagetop">
				<div class="greeting">Hi, <?php echo $_SESSION["administrator"];?> | <a href="Logout.php">Log out</a> 
				| <a href="AdministratorHomepage.php"> Home </a>
				</div>
				<div class="homepage"><?php echo $_SESSION["administrator"];?></div>
			</div>
			<form name="analysisRequest" action="ProcessCreateSampleDetail.php" method="post" onsubmit="return validateSampleEntry();">
				<div id="fieldname">
					<h2>SAMPLE ENTRY PAGE</h2>
				</div>		
				<table border="0" align="center" width="100%">
					<tr>
						<td>
							<div><?php if(isset($_GET["error"]))echo "Create Analysis Error"; else echo "";?></div>
							<table>
								<tr>
									<td><b>CASL No.:</b></td>
									<td><b><?php printf("%4d-%04d",date("o"),getNextCaslNum(date("o"),"casl","localhost","login","login"));?></b>
									<input type="hidden" name="samplestart" value="<?php echo getNextCaslNum(date("o"),"casl","localhost","login","login");?>"/></td>
								</tr>
								<tr>
									<td><b>Number of Samples:</b></td>
									<td><input type="text" name="samplecount" id="SampleCount"/></td>
									<td><div id="errorSampleCount" class="error"></div></td>
								</tr>
								<tr>
									<td><b>Received by:</b></td>
									<td><?php echo $_SESSION['name'];?></td>
									<td><div id="errorPreparedBy"></div></td>									
								</tr>
								<tr>
									<td><br/><h3>CLIENT INFORMATION</h3></td>
									<td></td>
									<td></td>
									<td></td>
								</tr>
								<tr>
									<td>Name/Representative:</td>
									<td><input type="text" name = "ClientName" id="ClientName"/></td>
									<td><div id="errorClientName" class="error"></div></td>
									<td></td>
								</tr>
								<tr>
									<td>Company:</td>
									<td><input type="text" name = "ClientCompany" id="ClientCompany"/></td>
									<td><div id="errorClientCompany" class="error"></div></td>
									<td></td>
								</tr>
								<tr>
									<td>Address:</td>
									<td><input type="text"  name = "ClientAddress" id="ClientAddress"/></td>
									<td><div id="errorClientAddress" class="error"></div></td>
									<td></td>
								</tr>
								<tr>
									<td>Contact Details </td>
									<td>Fax:</td>
									<td><input type="text" name = "ClientFax" id="ClientFax"/></td>
									<td><div id="errorClientFax" class="error"></div></td>
								</tr>
								<tr>
									<td></td>
									<td>Telephone Number:</td>
									<td><input type="text" name = "ClientTel" id="ClientTel"/></td>
									<td><div id="errorClientTel" class="error"></div></td>
								</tr>
								<tr>
									<td></td>
									<td>Email:</td>
									<td><input type="text" name = "ClientEmail" id="ClientEmail"/></td>
									<td><div id="errorClientEmail" class="error"></div></td>
								</tr>
								<tr>
									<td></td>
									<td>Cellphone Number:</td>
									<td><input type="text" name = "ClientCell" id="ClientCell"/></td>
									<td><div id="errorClientCell" class="error"></div></td>
								</tr>
							</table>
						</td>
					</tr>					
				</table>
				<table>
					<tr>
						<td>Date Submitted:
							<input type="hidden" name="day" value= "<?php echo date("d");?>" /> 
							<input type="hidden" name="month" value= "<?php echo date("m");?>" />
							<input type="hidden" name="year" value= "<?php echo date("o");?>" />
						</td>
						<td><b> <?php echo $date = date(" F d o");?> </b></td>
					</tr>
				</table>
				
				<div id="buttons">
					<input type="submit" value="Sample Detail Entry"/>		
					<input type="button" value="Home" 
							onClick='document.location.href = "AdministratorHomepage.php"'>
				</div>
			</form>
			<div id="footerwrap">
				<div id="footer"> 
					<div class="copyright">Copyright 2011.<a>CASL BIOTECH-UPLB.</a> All Rights Reserved.<br/> 
				Arianne Buse&ntilde;os | Darlene Joy Masong | Rick Jason Obrero | Jonathan Pandi | Jonathan Simbahan | Emmanuel Soriano 
					</div>  
	    	    </div>
			</div>			
		</div>		
	</body>
</html>